[SUBROUTINE]
version = 1.14
icon = polyline-mirrored.png
name = _("Mirror Polyline")
type = poly_miror_poly
help = _("<b>Duplicate and reverse a polyline</b>")
order = act fcut h1 dx dy rot h2 ax h6 gte comp dir s u_s ugc dpt u_dpt ugcd

[PARAM_ACT]
name = _("Active")
icon = enable.png
type = bool
value = 1

[PARAM_H1]
name = _("Offsets, rotation")
type = sub-header

[PARAM_H6]
name = _("Milling")
type = sub-header
header = h1

[PARAM_H2]
name = _("Mirror axis")
type = sub-header

[PARAM_DX]
name = _("dX")
header = h1
type = float
icon = x.png
tool_tip = _("Offset X")
value = 0
metric_value = 0.0

[PARAM_DY]
name = _("dY")
header = h1
type = float
icon = y.png
tool_tip = _("Offset Y")
value = 0
metric_value = 0.0

[PARAM_AX]
name = _("Axis")
header = h2
type = combo
tool_tip = _("Line or mirroring")
options = _("X=1:Y=0")
value = 1
icon = xy-axes.png

[PARAM_ROT]
name = _("Rotation")
header = h1
type = float
value = 0.0
icon = angle.png
digits = 2
tool_tip = _("Rotation center is origin")
suffix = &#176;

[PARAM_COMP]
name = _("Tool compensation")
header = h6
type = combo
options = _("None=40:Left=41:Right=42")
icon = g4x.png
tool_tip = _("Which side cutter will travel")
value = 40

[PARAM_DIR]
name = _("Direction")
header = H6
type = combo
options = _("Designed=0:Reverse=1")
icon = cw-ccw.png
tool_tip = _("Mill as designed or in reverse")
value = 0

[PARAM_S]
name = _("Cut start")
type = combo-user
options = _("User defined=0:Surface=1:Half=2:One quarter=3:Three quarter=4:G-Code=5")
icon = surface.png
tool_tip = _("Pre or user defined")
value = 1
header = h6
links = u_s=0:ugc=5

[PARAM_U_S]
name = _("User start")
type = float
value = 0.0
metric_value = 0.0
header = h6
hidden = 1

[PARAM_UGC]
name = User gcode
type = gcode
value = 
header = h6
hidden = 1

[PARAM_UGCD]
name = User depth gcode
type = gcode
value =
header = h6
hidden = 1

[PARAM_DPT]
name = _("Cut down to")
type = combo-user
options = _("User defined=0:Through=1:Bottom=2:Half=3:One quarter=4:Three quarter=5:G-Code=6")
icon = depth.png
tool_tip = _("Pre or user defined")
value = 1
header = h6
links = u_dpt=0:ugcd=6

[PARAM_U_DPT]
name = _("User depth")
type = float
value = -0.5
metric_value = -12.0
header = h6
hidden = 1

[PARAM_FCUT]
name = _("Show design")
icon = glasses.png
type = bool
value = 1

[PARAM_GTE]
name = _("Global tool engagement")
icon = tool-eng.png
type = float
value = 100
digits = 0
header = h6
maximum_value = 100
minimum_value = 0
suffix = %
hidden = 1

[CALL]
content =
	(begin #sub_name)
	(create a mirrored polyline from the previous one author : Fernand Veilleux)
	
	o<#self_id_active> if  [#param_act AND [#<in_polyline> EQ 0] AND [#5000 GT 0]]
	
		o<poly_mirror_p> CALL [#param_ax]
		
		o<#self_id_rev> if [#param_dir]
			o<poly_reverse> CALL
		o<#self_id_rev> endif
		
		o<poly_copy_mill> CALL
		
		o<select> CALL [31] [#param_s] [#param_u_s] [#<surface>] [#<surface> - #<wp_depth> / 2] [#<surface> - #<wp_depth> / 4] [#<bottom> + #<wp_depth> / 4] [#param_ugc]
		o<select> CALL [32] [#param_dpt] [#param_u_dpt] [#<bottom_through>] [#<bottom>] [#<surface> - #<wp_depth> / 2] [#<surface> - #<wp_depth> / 4] [#<bottom> + #<wp_depth> / 4] [#param_ugcd]
	
		o<poly_mill> CALL [#<_mill_data_start>] [#31] [#32] [#param_comp] [#param_fcut] [#param_dx] [#param_dy] [#param_rot] [#param_gte / 100]
	
	o<#self_id_active> endif
	(end #sub_name)
